#ifndef __APP_MSG_H
#define __APP_MSG_H
#include "app_common.h"

typedef struct
{
    char *connetType;
    int motorId;
    char *action;
    int16_t motorSpeed;
    char *status;
} msg_t;

gate_state_t json_2_msg(char *json, msg_t *msg);

gate_state_t msg_2_json(msg_t *msg, char json[]);

#endif

/*
设置电机速度:
    {
        "connType": "rs485",
        "motorId": 9,
        "action": "set",
        "motorSpeed": -1009
    }
获取电机速度:
    {
        "connType": "rs485",
        "motorId": 9,
        "action": "get"
    }

    返回电机速度:
    {
        "connType": "rs485",
        "motorId": 9,
        "action": "get",
        "motorSpeed": -1009,
        "status": "ok"   // ok or error
    }



*/
